#ifndef FREESTYLE_STATE_H
#define FREESTYLE_STATE_H

#include "State.hpp"

/**
 * Whilst in FreestyleState the robot will keep driving forward until a CollisionEvent or a ProximityEvent occurs.
 * When once of these events occurs the robot will perform an evasive maneuver.
 */
class FreestyleState : public State
{
public:
	/**
	 * Create a new FreeStyleState
	 */
	FreestyleState();

	/**
	 * Handle a new event
	 */
	virtual void handleEvent(Event& event);

	/**
	 * Initialize the FreeStyleState
	 */
	virtual void startState();

	/**
	 * @see State.getStateType()
	 */
	virtual StateType getStateType();
private:
	/**
	 * Perform evasive maneuver
	 */
	void avoidObstacle();


	enum Status
	{
		FORWARD,
		BACKWARD,
		TURNING
	};

//	void resumeAvoidObstacle(Status status);
//	void partialWait();

	Status currentStatus;
	unsigned int timeLeft;
};
#endif
